using System;
using System.Threading;

namespace InfiniTec.Threading
{
    public class WaitForHandleOperation: OperationProgress
    {
        private readonly WaitHandle _WaitHandle;
    	private TimeSpan? _Timeout;


    	public WaitForHandleOperation(WaitHandle waitHandle) : this(waitHandle, null, 0)
        {
        }

        public WaitForHandleOperation(WaitHandle waitHandle, object status) : this(waitHandle, status, 0)
        {
        }

        public WaitForHandleOperation(WaitHandle waitHandle, object status, int progressPercentage): base(status, progressPercentage)
        {
            _WaitHandle = waitHandle;
        }

        public WaitHandle WaitHandle { get { return _WaitHandle; } }

    	public TimeSpan? Timeout
    	{
    		get {
    			return _Timeout;
    		}
    		set {
    			_Timeout = value;
    		}
    	}
    }
}